package com.bsj.power.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bsj.power.common.def.dto.cardReport.CardReportSearchDTO;
import com.bsj.power.common.def.entity.cardReport.CardReport;
import com.bsj.power.common.def.vo.KeyValueVO;
import com.bsj.power.common.def.vo.pls.BindNumberVO;
import com.bsj.power.common.def.vo.pls.CardReportVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Locale;
import java.util.Map;

/**
 * @author LiJiaXin
 * @version 1.0.0
 * @description CardReportMapper
 * @time 2024/4/23 19:06
 */
public interface CardReportMapper extends BaseMapper<CardReport> {

    /**
     * 统计数量
     *
     * @param cardReportSearchDTO
     * @return long
     * @author ljx
     * @time 2024/4/23 20:12
     */
    long countCardReport(CardReportSearchDTO cardReportSearchDTO);

    /**
     * 智慧领卡报表
     *
     * @param cardReportSearchDTO
     * @return java.util.List<com.bsj.power.common.def.vo.pls.CardReportVO>
     * @author ljx
     * @time 2024/4/23 20:33
     */
    List<CardReportVO> pageCardReport(CardReportSearchDTO cardReportSearchDTO);

    /**
     * 按类型分组统计进出场人员数量
     *
     * @param startTime
     * @param endTime
     * @return java.util.Map<java.lang.String, java.lang.Long>
     * @author ljx
     * @time 2024/6/7 17:01
     */
    Map<String, Long> groupCountByType(@Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 按时间查询类型为绑卡的记录
     *
     * @param startTime
     * @param endTime
     * @return java.util.List<com.bsj.power.common.def.entity.cardReport.CardReport>
     * @author ljx
     * @time 2024/12/19 11:14
     */
    List<CardReport> selectByTime(@Param("startTime") String startTime, @Param("endTime") String endTime);

    /**
     * 绑卡次数统计
     *
     * @param cardReportSearchDTO
     * @return java.util.List<com.bsj.power.common.def.vo.KeyValueVO>
     * @author ljx
     * @time 2024/12/19 16:54
     */
    List<KeyValueVO> cardBindTimeCount(CardReportSearchDTO cardReportSearchDTO);
}
